package Pages;

import appium1.common.Helper;
import org.openqa.selenium.WebElement;

public class PageCommon {
    private Helper helper;

    public PageCommon(Helper helper) {
        this.helper = helper;
    }

    public WebElement getHomeTab() {
        return helper.findById("net.oschina.app:id/nav_item_news");
    }

    public WebElement getMomentTab() {
        return helper.findById("net.oschina.app:id/nav_item_tweet");
    }

    public WebElement getPublisBtn() {
        return helper.findById("net.oschina.app:id/nav_item_tweet_pub");
    }

    public WebElement getExploreTab() {
        return helper.findById("net.oschina.app:id/nav_item_explore");
    }

    public WebElement getMyTab() {
        return helper.findById("net.oschina.app:id/nav_item_me");
    }

    public void goToHomeTab() {
        helper.click(getHomeTab());
    }

    public void goToMomentTab() {
        helper.click(getMomentTab());
    }

    public void gotoPublisBtn() {
        helper.click(getPublisBtn());
    }

    public void gotoExploreTab() {
        helper.click(getExploreTab());
    }

    public void gotoMyTab() {
        helper.click(getMyTab());
    }
    public void goBack(){
        helper.goBack();
    }
}
